feat(decopilot): add tool approval workflow#2452
Merged
Conversation
…ique to review-pr - Rename skill directories for clearer naming - Update skill names, descriptions, and internal references - Update plan-with-critique to reference review-plan Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements server-side support for tool approval levels, allowing users
to require approval before tools execute. Integrates with AI SDK 6
approval flow.
Changes:
- Add ToolApprovalLevel type ("none", "readonly", "yolo")
- Add toolNeedsApproval() helper to determine approval requirements
- Pass toolApprovalLevel through tool creation pipeline
- Update built-in tools (subtask, agent_search) to support approval
- Add needsApproval parameter to MCP tool conversion
- Extend ToolResultOutputSchema to support execution-denied state
- Update thread status resolution to handle approval-requested state
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements client-side UI for tool approval workflow, allowing users to approve or deny tool executions before they run. Changes: - Add ApprovalActions component with approve/deny buttons - Update tool-call-part components to render approval actions - Add toolApprovalLevel preference (none/readonly/yolo) - Add Tool Approval section to user settings dialog - Integrate approval flow with chat context and AI SDK - Suppress warnings when tools are awaiting approval - Add utility functions for approval state management Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds comprehensive test coverage for tool approval functionality. Changes: - Add helpers.test.ts with 9 tests for toolNeedsApproval logic - Add 5 status.test.ts tests for approval-requested state handling - Test all approval level combinations (none/readonly/yolo) - Test readOnlyHint interactions with approval levels - Test thread status resolution with approval states Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
🧪 BenchmarkShould we run the Virtual MCP strategy benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
Contributor
Release OptionsShould a new version be published when this PR is merged? React with an emoji to vote on the release type:
Current version: Deployment
|
Contributor
There was a problem hiding this comment.
1 issue found across 25 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/mesh/src/api/routes/decopilot/helpers.ts">
<violation number="1" location="apps/mesh/src/api/routes/decopilot/helpers.ts:67">
P2: Defaulting toolApprovalLevel to "yolo" means any caller that omits the level (e.g., the subtask subagent loader) will auto-approve all MCP tools, bypassing the approval workflow. Consider defaulting to the safest level so approvals aren’t skipped when a caller forgets to pass the level.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
pedrofrxncx
approved these changes
Feb 14, 2026
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Changes: - Prefix detail sections with '#' for better Markdown formatting in tool call messages (Input, Error, Output).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this contribution about?
This PR implements a tool approval workflow for decopilot, allowing users to control when tools execute by requiring explicit approval. This feature integrates with AI SDK 6's built-in approval flow and provides three approval levels:
The implementation includes:
toolApprovalLevelparameterScreenshots/Demonstration
N/A - This is a backend/workflow feature. The UI changes are minimal (approve/deny buttons appear when tools need approval).
How to Test
Set approval level to "none":
Trigger a tool call:
agent_searchtoolVerify approval workflow:
Test readonly mode:
Test YOLO mode:
Verify thread status:
Migration Notes
N/A - No database migrations or configuration changes required. The feature uses existing AI SDK 6 approval mechanisms.
Review Checklist
Additional Notes
Architecture decisions:
needsApprovalparametertoolsFromMCP()conversionKnown limitations:
Follow-up work:
Summary by cubic
Adds a tool approval workflow to Decopilot so users can approve or deny tool runs. Supports None, Read-only, and YOLO modes with a simple UI, user preference, end-to-end AI SDK 6 approvals, and clearer tool call details.
New Features
Refactors
Written for commit 6d04e1b. Summary will update on new commits.